package com.sgb.kjwl.model.entity.transport;

import android.text.TextUtils;

import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.google.gson.annotations.SerializedName;
import com.swgk.core.base.model.entity.VideoBean;

import java.util.List;

public class GoodsInfoEntity implements MultiItemEntity {

    public static final String PERSONAL_CODE = "3";
    public static final String COMPANY_CODE = "1";
    public static final String TEAM_CODE = "2";


    /**
     * carLenName : 2.4米
     * carModelName : 低栏
     * cityName : 北京市
     * companyName : 王贤成开发公司
     * destCityName : 北京市
     * destDistrictName : 西城区
     * destProvinceName : 北京
     * distance :
     * districtName : 东城区
     * freight : 1.0
     * goodsModeName : 冷冻
     * id : 710
     * isReception : 0
     * no : 20200907369115
     * pattern : 0
     * provinceName : 北京
     * shipmentEndTime : 1602172800000
     * shipmentTime : 1599494400000
     * state : 0
     * timeSort : 0
     * weight : 1.0
     */

    private String carLenName;
    private String cityName;
    private String companyName;
    private String destCityName;
    private String destDistrictName;
    private String destProvinceName;
    private String distance;
    private String districtName;
    private String freight;
    private int id;
    private int isReception;
    private String no;
    private int pattern;
    private String provinceName;
    private Long shipmentEndTime;
    private Long shipmentTime;
    private int state;
    private int timeSort;
    private String weight;

    private double latitude;
    private double longitude;
    private String contrctsNumber;
    private String imAccount;
    private String imToken;
    private String orderNo;

    private String endAddr;
    private String contrcts;

    private String startAddr;
    private String offerStatus;
    private String goodsModelName;
    @SerializedName(value = "goodsModeName",alternate = {"goodsTypeName"})
    private String goodsModeName;
    @SerializedName(value = "carTypeName",alternate = {"carModelName"})
    private String carModelName;
    @SerializedName(value = "logo",alternate = {"companyLogo"})
    private String companyLogo;
    private String messagePrice;
    private String goodsOfferNo;
    private String heightHurdle;
    private Integer isDump;
    private String journey;
    //"1：企业发布 / 2：团队发布" 3：个人发布
    private String terminal;
    private String teamNo;
    private String companyNo;
    private String userNo;
    private String contrctsImAccount;
    private String lowestPrice;//经营邦app 最低报价
    private Integer carNumber;//经营邦app 意向车数
    private Integer type;
    private List<VideoBean> videoList;
    private String allFreight;//总运费

    /**
     * 运输方式 0 零担 1 整车
     */
    private Integer transportType;

    /**
     * 装车开始时间点  2.0.6
     * 25——表示全天
     */
    private int startPointTime;

    /**
     * 装车结束时间点  2.0.6
     * 25——表示全天
     */
    private int endPointTime;
    /**
     * 运费选项 0一口价 1电议
     */
    private int freightType;
    //2.0.8新增
    private String offerType;
    /**货物体积*/
    private String volume;
    private String secondGoodsTypeName;//二级货物名称

    private String connection;//联系人
    private String connectionPhone;//联系电话

    public String getConnection() {
        return connection;
    }

    public void setConnection(String connection) {
        this.connection = connection;
    }

    public String getConnectionPhone() {
        return connectionPhone;
    }

    public void setConnectionPhone(String connectionPhone) {
        this.connectionPhone = connectionPhone;
    }

    public String getTeamNo() {
        return TextUtils.isEmpty(teamNo) ? "" : teamNo;
    }

    public void setTeamNo(String teamNo) {
        this.teamNo = teamNo;
    }

    public String getCompanyNo() {
        return TextUtils.isEmpty(companyNo) ? "" : companyNo;
    }

    public void setCompanyNo(String companyNo) {
        this.companyNo = companyNo;
    }

    public String getUserNo() {
        return TextUtils.isEmpty(userNo) ? "" : userNo;
    }

    public void setUserNo(String userNo) {
        this.userNo = userNo;
    }

    public int getFreightType() {
        return freightType;
    }

    public void setFreightType(int freightType) {
        this.freightType = freightType;
    }

    public int getStartPointTime() {
        return startPointTime;
    }

    public void setStartPointTime(int startPointTime) {
        this.startPointTime = startPointTime;
    }

    public int getEndPointTime() {
        return endPointTime;
    }

    public void setEndPointTime(int endPointTime) {
        this.endPointTime = endPointTime;
    }

    public Integer getTransportType() {
        return transportType;
    }

    public void setTransportType(Integer transportType) {
        this.transportType = transportType;
    }

    public String getTerminal() {
        return TextUtils.isEmpty(terminal) ? "1" : terminal;
    }

    public void setTerminal(String terminal) {
        this.terminal = terminal;
    }

    public String getAllFreight() {
        return TextUtils.isEmpty(allFreight) ? "0" : allFreight;
    }

    public void setAllFreight(String allFreight) {
        this.allFreight = allFreight;
    }

    public List<VideoBean> getVideoList() {
        return videoList;
    }

    public void setVideoList(List<VideoBean> videoList) {
        this.videoList = videoList;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getLowestPrice() {
        return lowestPrice;
    }

    public void setLowestPrice(String lowestPrice) {
        this.lowestPrice = lowestPrice;
    }

    public Integer getCarNumber() {
        if (carNumber == null)
            return 0;
        return carNumber;
    }

    public void setCarNumber(Integer carNumber) {
        this.carNumber = carNumber;
    }

    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public String getContrctsImAccount() {
        return contrctsImAccount;
    }

    public void setContrctsImAccount(String contrctsImAccount) {
        this.contrctsImAccount = contrctsImAccount;
    }

    public Integer getIsDump() {
        return isDump;
    }

    public void setIsDump(Integer isDump) {
        this.isDump = isDump;
    }

    public String getHeightHurdle() {
        return heightHurdle;
    }

    public void setHeightHurdle(String heightHurdle) {
        this.heightHurdle = heightHurdle;
    }

    public String getGoodsOfferNo() {
        return goodsOfferNo;
    }

    public void setGoodsOfferNo(String goodsOfferNo) {
        this.goodsOfferNo = goodsOfferNo;
    }

    public String getMessagePrice() {
        return messagePrice;
    }

    public void setMessagePrice(String messagePrice) {
        this.messagePrice = messagePrice;
    }

    public String getCompanyLogo() {
        return companyLogo;
    }

    public void setCompanyLogo(String companyLogo) {
        this.companyLogo = companyLogo;
    }

    public String getContrcts() {
        return contrcts;
    }

    public void setContrcts(String contrcts) {
        this.contrcts = contrcts;
    }

    public String getOfferStatus() {
        return offerStatus;
    }

    public void setOfferStatus(String offerStatus) {
        this.offerStatus = offerStatus;
    }

    public String getGoodsModelName() {
        return TextUtils.isEmpty(goodsModelName) ? "" : goodsModelName;
    }

    public void setGoodsModelName(String goodsModelName) {
        this.goodsModelName = goodsModelName;
    }

    public String getEndAddr() {
        return endAddr;
    }

    public void setEndAddr(String endAddr) {
        this.endAddr = endAddr;
    }

    public String getStartAddr() {
        return startAddr;
    }

    public void setStartAddr(String startAddr) {
        this.startAddr = startAddr;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getImAccount() {
        return imAccount;
    }

    public void setImAccount(String imAccount) {
        this.imAccount = imAccount;
    }

    public String getImToken() {
        return imToken;
    }

    public void setImToken(String imToken) {
        this.imToken = imToken;
    }

    public String getContrctsNumber() {
        return contrctsNumber;
    }

    public void setContrctsNumber(String contrctsNumber) {
        this.contrctsNumber = contrctsNumber;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }


    public String getCarLenName() {
        return TextUtils.isEmpty(carLenName) ? "" : carLenName;
    }

    public void setCarLenName(String carLenName) {
        this.carLenName = carLenName;
    }

    public String getCarModelName() {
        return TextUtils.isEmpty(carModelName) ? "" : carModelName;
    }

    public void setCarModelName(String carModelName) {
        this.carModelName = carModelName;
    }

    public String getCityName() {
        return TextUtils.isEmpty(cityName) ? "" : cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getDestCityName() {
        return TextUtils.isEmpty(destCityName) ? "" : destCityName;
    }

    public void setDestCityName(String destCityName) {
        this.destCityName = destCityName;
    }

    public String getDestDistrictName() {
        return TextUtils.isEmpty(destDistrictName) ? "" : destDistrictName;
    }

    public void setDestDistrictName(String destDistrictName) {
        this.destDistrictName = destDistrictName;
    }

    public String getDestProvinceName() {
        return destProvinceName;
    }

    public void setDestProvinceName(String destProvinceName) {
        this.destProvinceName = destProvinceName;
    }

    public String getDistance() {
        return distance;
    }

    public void setDistance(String distance) {
        this.distance = distance;
    }

    public String getDistrictName() {
        return TextUtils.isEmpty(districtName) ? "" : districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public String getFreight() {
        return TextUtils.isEmpty(freight) ? "0" : freight;
    }

    public void setFreight(String freight) {
        this.freight = freight;
    }

    public String getGoodsModeName() {
        return TextUtils.isEmpty(goodsModeName) ? "" : goodsModeName;
    }

    public void setGoodsModeName(String goodsModeName) {
        this.goodsModeName = goodsModeName;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getIsReception() {
        return isReception;
    }

    public void setIsReception(int isReception) {
        this.isReception = isReception;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public int getPattern() {
        return pattern;
    }

    public void setPattern(int pattern) {
        this.pattern = pattern;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public Long getShipmentEndTime() {
        return shipmentEndTime;
    }

    public void setShipmentEndTime(Long shipmentEndTime) {
        this.shipmentEndTime = shipmentEndTime;
    }

    public Long getShipmentTime() {
        return shipmentTime;
    }

    public void setShipmentTime(Long shipmentTime) {
        this.shipmentTime = shipmentTime;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public int getTimeSort() {
        return timeSort;
    }

    public void setTimeSort(int timeSort) {
        this.timeSort = timeSort;
    }


    public String getJourney() {
        return journey;
    }

    public void setJourney(String journey) {
        this.journey = journey;
    }

    public String getOfferType() {
        return offerType;
    }

    public void setOfferType(String offerType) {
        this.offerType = offerType;
    }
    public String getOfferTypeWorlds() {
        if (TextUtils.isEmpty(offerType))return "";
        StringBuffer other = new StringBuffer();
        String[] strArray = offerType.split(",");
        for (int i = 0;i<strArray.length;i++){
            if ("1".equals(strArray[i])){
                other.append("企业");
            }else if ("2".equals(strArray[i])){
                if (other.length()!=0){
                    other.append("/");
                }
                other.append("团队");
            }else if ("3".equals(strArray[i])){
                if (other.length()!=0){
                    other.append("/");
                }
                other.append("个人（司机）");
            }
        }
        return other.toString();
    }

    public String getVolume() {
        return volume;
    }

    public void setVolume(String volume) {
        this.volume = volume;
    }

    public String getSecondGoodsTypeName() {
        return secondGoodsTypeName;
    }

    public void setSecondGoodsTypeName(String secondGoodsTypeName) {
        this.secondGoodsTypeName = secondGoodsTypeName;
    }

    public String getGoodsLastTypeName() {
        String name = "";
        if (!TextUtils.isEmpty(secondGoodsTypeName)) {
            name = secondGoodsTypeName;
        } else if (!TextUtils.isEmpty(goodsModeName)) {
            name = goodsModeName;
        }
        return name;
    }

    @Override
    public int getItemType() {
        if (videoList == null || videoList.size() == 0) {
            return SingleItemConstant.TYPE_ONE;
        }
        return SingleItemConstant.TYPE_TWO;
    }
}
